#!/usr/bin/env python
#    dft_qr_qlop
#    ------------------
#    Molecule:         H2O
#    Wave Functions:   DFT B3LYP / STO-3G
#    Test Purpose:     DFT B3LYP hyperpolarizability test w/ symmetry.

import os
import sys

sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from runtest_dalton import Filter, TestRun

test = TestRun(__file__, sys.argv)

f = Filter()
f.add(string = 'Final DFT energy',
      rel_tolerance = 4.0e-9)

#Certain components in legacy test are to 2 decimal in accuracy
f.add(re = '0\.[01].*0\.[01].*beta\([XYZ];[XYZ],[XYZ]\)',
      rel_tolerance = 1.0e-2)

# Z; Y, Y and Y; Z, Z in 3 decimal accuracy
f.add(re = '0\.[01].*0\.[01].*beta\(Z;Z,Y\)',
      rel_tolerance = 1.0e-3)
f.add(re = '0\.[01].*0\.[01].*beta\(Z;Z,Y\)',
      rel_tolerance = 1.0e-3)

f.add(re = '0\.1.*0\.0.*beta\(Y;Z,Z\)',
      rel_tolerance = 1.0e-3)
f.add(re = '0\.1.*0\.1.*beta\(Y;Z,Z\)',
      rel_tolerance = 1.0e-3)


test.run( ['dft_qr_qlop.dal'], ['dft_qr_qlop.mol'], f={'out': f})

sys.exit(test.return_code)


